<template>
  <TableView
    ref="tableView"
    :table-attrs="{ api: getPage, descs: ['createTime'], payloadStyle: 'body', dicOptions: [] }"
    form-path="/library/bookApply/BookApplyForm/{id:-1}"
    :search-model="searchForm"
    :delete-api="batchDelete"
    :toolbar-attrs="{ buttons: ['slot', 'del', 'create'] }">
    <template #columns>
      <TableColumn label="借阅人" clickable prop="borrower" />
      <TableColumn label="卡号" prop="cardNumber" />
      <TableColumn label="借阅时间" prop="createTime" />
      <TableColumn
        label="状态"
        prop="status"
        :options="[
          { label: '草稿', value: 0 },
          { label: '审批中', value: 1 },
          { label: '办结', value: 2 }
        ]" />
    </template>
  </TableView>
</template>

<script>
  import { getPage, batchDelete } from './api'

  export default {
    name: 'BookApplyView',
    data() {
      return {
        searchForm: {}
      }
    },
    methods: {
      getPage,
      batchDelete
    }
  }
</script>
